package net.crowdloud.client.user;

import net.crowdloud.client.GlobalVariables;
import net.crowdloud.shared.entities.User;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;

public class UpdateUser {

	public UpdateUser(final User user) {

		final UserDatabaseServerCallsAsync databaseServerCalls = GWT
				.create(UserDatabaseServerCalls.class);

		databaseServerCalls.updateUser(user,
				GlobalVariables.tags.getTagsList(), new AsyncCallback<Void>() {

					public void onSuccess(Void result) {

						new GetUser(user);
					}

					public void onFailure(Throwable caught) {
						// Show the RPC error message to the user

					}

				});

	}

}
